﻿<Window x:Class="IBR.StringResourceBuilder2011.GUI.SettingsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:gi="clr-namespace:GreyableImage"
        xmlns:my="clr-namespace:IBR.StringResourceBuilder2011.GUI"
        mc:Ignorable="d"
        Icon="/IBR.StringResourceBuilder2011;component/Button%20Bitmaps/translator.png"
        Title="String Resource Builder Settings"
        WindowStartupLocation="CenterScreen"
        MinWidth="619"
        MinHeight="376"
        d:DesignWidth="619"
        d:DesignHeight="376"
        SizeToContent="WidthAndHeight">
  <Window.Resources>
    <!--Image-->
    <Style TargetType="Image">
      <Setter Property="gi:ImageGreyer.IsGreyable" Value="True"/>
    </Style>
    <Style TargetType="{x:Type my:NumericUpDown}">
      <Setter Property="HorizontalAlignment" Value="Center"/>
      <Setter Property="VerticalAlignment" Value="Center"/>
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type my:NumericUpDown}">
            <Grid Margin="2">
              <Grid.RowDefinitions>
                <RowDefinition Height="10"/>
                <RowDefinition Height="1"/>
                <RowDefinition Height="10"/>
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="17"/>
              </Grid.ColumnDefinitions>

              <TextBox Grid.RowSpan="3" Margin="0" TextAlignment="Right"
                       Text="{Binding RelativeSource={x:Static RelativeSource.TemplatedParent}, Path=Value}" />
              <RepeatButton Grid.Column="1" Grid.Row="0" Command="{x:Static my:NumericUpDown.IncreaseCommand}">
                <Polygon Fill="Black" Points="0,4 3,1 6,4"/>
              </RepeatButton>
              <RepeatButton Grid.Column="1" Grid.Row="2" Command="{x:Static my:NumericUpDown.DecreaseCommand}">
                <Polygon Fill="Black" Points="0,1 3,4 6,1"/>
              </RepeatButton>
            </Grid>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
  </Window.Resources>
  <Grid UseLayoutRounding="True">
    <Grid.RowDefinitions>
      <RowDefinition Height="*"/>
      <RowDefinition Height="43"/>
    </Grid.RowDefinitions>
    <TabControl Grid.Row="0" Margin="8,8,8,0">
      <TabItem Header="Options" Name="tabiOptions">
        <Grid>
          <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
          </Grid.RowDefinitions>
          <GroupBox Grid.Row="0" Margin="2" Header="Ignore Options">
            <StackPanel Margin="2,8,2,2">
              <CheckBox Margin="0,-5,0,4" Name="cbIgnoreUpToNCharactersStrings">
                <StackPanel Orientation="Horizontal">
                  <TextBlock VerticalAlignment="Center" Text="Ignore strings with " />
                  <my:NumericUpDown MinValue="2" Value="2" Width="50" x:Name="nudIgnoreStringLength"
                                    IsEnabled="{Binding ElementName=cbIgnoreUpToNCharactersStrings, Path=IsChecked}" />
                  <TextBlock VerticalAlignment="Center" Text=" characters or less" />
                </StackPanel>
              </CheckBox>
              <CheckBox Margin="0,0,0,8" Name="cbIgnoreWhiteSpaceStrings" Content="Ignore white space strings (entirely blanks and/or tabs)" />
              <CheckBox Margin="0,0,0,8" Name="cbIgnoreNumberStrings" Content="Ignore number strings (&quot;1234&quot;, &quot;12.34&quot;, &quot;  1234&quot;, &quot;1234  &quot; but not &quot;123  4&quot;, &quot;12,34&quot;)"></CheckBox>
              <CheckBox Margin="0,0,0,8" Name="cbIgnoreVerbatimStrings" Content="Ignore verbatim strings (preceded by '@' character as in @&quot;my string&quot;)"></CheckBox>
            </StackPanel>
          </GroupBox>
          <GroupBox Grid.Row="1" Margin="2" Header="Other Options">
            <StackPanel Margin="2,8,2,2">
              <CheckBox Margin="0,-5,0,4" Name="cbUseGlobalResourceFile">
                <StackPanel Orientation="Horizontal">
                  <TextBlock VerticalAlignment="Center" Text="Use global resource file" />
                  <TextBox MinWidth="20" Margin="4,2,0,2" VerticalAlignment="Center" Name="txtGlobalResourceFileName"
                           IsEnabled="{Binding ElementName=cbUseGlobalResourceFile, Path=IsChecked}" FontFamily="Consolas, Courier New" />
                  <TextBlock VerticalAlignment="Center" Text=".Resources.resx" FontFamily="Consolas, Courier New" />
                  <TextBlock VerticalAlignment="Center" Text=" (leave blank for the standard global resource file)" />
                </StackPanel>
              </CheckBox>
            </StackPanel>
          </GroupBox>
        </Grid>
      </TabItem>
      <TabItem Header="Strings">
        <Grid>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>
          <my:ctlListEditor Grid.Column="0" x:Name="lstIgnoreStrings" Header="Ignore these Strings" />
          <my:ctlListEditor Grid.Column="1" x:Name="lstIgnoreSubStrings" Header="Ignore Strings containing these Strings" />
        </Grid>
      </TabItem>
      <TabItem Header="Methods &amp; Functions">
        <Grid>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>
          <my:ctlListEditor Grid.Column="0" x:Name="lstIgnoreMethods" Header="Ignore these Methods or Functions" />
          <my:ctlListEditor Grid.Column="1" x:Name="lstIgnoreArguments" Header="Ignore Arguments of these Methods or Functions" />
        </Grid>
      </TabItem>
    </TabControl>
    <StackPanel Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal" VerticalAlignment="Bottom" Margin="0,0,8,0">
      <Button Height="27" Margin="0,8,8,8" Name="btnOK" VerticalAlignment="Center" Width="89" Click="btnOK_Click" ToolTip="Accept all changes made">
        <StackPanel Orientation="Horizontal">
          <Image Height="16" Width="16" Source="/IBR.StringResourceBuilder2011;component/Images/bt_apply_shadow.png" Stretch="None" />
          <TextBlock Text="OK" Margin="4,0,0,0"/>
        </StackPanel>
      </Button>
      <Button Height="27" Margin="0,8,8,8" Name="btnCancel" VerticalAlignment="Center" Width="89" Click="btnCancel_Click" ToolTip="Cancel all changes made">
        <StackPanel Orientation="Horizontal">
          <Image Height="16" Width="16" Source="/IBR.StringResourceBuilder2011;component/Images/bt_del_shadow.png" Stretch="None" />
          <TextBlock Text="Cancel" Margin="4,0,0,0"/>
        </StackPanel>
      </Button>
    </StackPanel>
  </Grid>
</Window>
